package com.riant.day07;

import java.util.HashSet;

import java.util.Iterator;
import java.util.Set;

/**
 * @Classname Demo01
 * @Description TODO
 * @Date 2021/3/20 10:14
 * @Created by 张斌
 */
public class Demo01 {
    public static void main(String[] args) {
        Set<String> set = new HashSet<String>();
        set.add("zhansna");
        set.add("lisi");
        set.add("wangwu");
        set.forEach(item -> {
            if (item.equals("lisi")) {
                System.out.println(item+"显示");
            }
        });
        Iterator iterator=set.iterator();
        while(iterator.hasNext()){
            System.out.println(iterator.next());
        }
        iterator.remove();
        System.out.println("==================");
        Iterator iterator2=set.iterator();
        while(iterator2.hasNext()){
            System.out.println(iterator2.next());
        }

    }
}
